#include <iostream>
#include <sys/select.h>
#include "Socket.hpp"
#include <memory>
class SelectServer
{
    const static int size = sizeof(fd_set) * 8;
    const static int defaultfd = -1;

public:
    SelectServer(uint16_t port) : _select(std::make_unique<TcpSocket>()), _isruning(false)
    {
        _select->BuildTcpSocketServer(port); // 构建服务器

        //先将监听套接字放入辅助数组

    }
    void Start()
    {
        _isruning = true;
        while (_isruning)
        {
            // 监听时有客户端访问就相当于读端准备好了
            fd_set fdr;
            //初始化+将需要监视的套接字设置进去
            FD_CLR(_select->)
        }
    }
    ~SelectServer()
    {
    }

private:
    std::unique_ptr<Socket> _select;
    bool _isruning;
    int _fds[size];
};